
import json

import requests


def  user_login(username,password):
    url = "http://yun.zenm.vip/iot/account/login/"
    header = {
        "Content-Type": "application/json"
    }
    data = {
        "username": username,
        "password": password
    }
    json_data = json.dumps(data)

    # 使用requests发送请求
    res = requests.post(url=url, data=json_data, headers=header)
    json_data = res.json()

    return json_data